From: Giuseppe Scrivano Date: Tue, 21 Oct 2014 14:20:58 +0000 (+0200) Subject: tests: fix --help test X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~1082 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=22a82341b10299f70903ad7a49fafcf3446a248f;p=ostree.git tests: fix --help test Check for "Usage" only in the root command, builtins may not output it. Signed-off-by: Giuseppe Scrivano --- diff --git a/tests/test-help.sh b/tests/test-help.sh index db7f65d7..4c1ffadd 100755 --- a/tests/test-help.sh +++ b/tests/test-help.sh @@ -26,11 +26,15 @@ echo "1..1" echo "Testing:" 1>&2 test_recursive() { local cmd=$1 + local root=$2 + echo "$cmd" 1>&2 $cmd --help 1>out 2>err # --help message goes to standard output - assert_file_has_content out "[Uu]sage" - assert_file_has_content out "$cmd" + if [ "$root" == "1" ] ; then + assert_file_has_content out "[Uu]sage" + assert_file_has_content out "$cmd" + fi assert_file_empty err builtins=`sed -n '/^Builtin commands/,/^[^ ]/p'